package com.yaoyong.yy_demo.config;

import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.core.type.filter.TypeFilter;

/**
 * 自定义不扫描的类
 *
 * @author 86188
 */
public class ScanExcludeFilter implements TypeFilter {
    @Override
    public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) {
        String className = metadataReader.getClassMetadata().getClassName();
        boolean b1 = className.startsWith("com.yaoyong.yy_demo.module.spring5");
        boolean b2 = className.startsWith("com.yaoyong.yy_demo.module.springboot");
        if (b1 || b2) {
            System.err.println("不扫描的类: " + className);
        }
        return b1 || b2;
    }
}
